From: Tom Levy Date: Tue, 9 Nov 2021 12:05:28 +0000 (+0000) Subject: Allow 'undo-redo' to be called from Lisp without repeat count X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~4110^2~33 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=315d550bf7ff9444bec98e8b44c4fd2bf12b492c;p=emacs.git Allow 'undo-redo' to be called from Lisp without repeat count * lisp/simple.el (undo-redo): Default arg to 1 to avoid error when called from Lisp without args (bug#51718). Copyright-paperwork-exempt: yes --- diff --git a/lisp/simple.el b/lisp/simple.el index 82e373be9e6..ad6d28cb14d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3114,7 +3114,7 @@ Interactively, ARG is the prefix numeric argument and defaults to 1." (let ((undo-in-progress t)) (while (and (consp ul) (eq (car ul) nil)) (setq ul (cdr ul))) - (primitive-undo arg ul))) + (primitive-undo (or arg 1) ul))) (new-pul (undo--last-change-was-undo-p new-ul))) (message "Redo%s" (if undo-in-region " in region" "")) (setq this-command 'undo)